﻿using BCCommon.FreightEnums;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
//using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCEntity.MongoDB.Location
{
    /// <summary>
    /// 车辆司机
    /// </summary>
    public class LocationDriverEntity
    {
        private double longitude;
        private double latitude;

        /// <summary>
        /// kafka临时消息Id
        /// </summary>
        [BsonId]
        public string TemplateMessageId { get; set; }
        /// <summary>
        /// 司机编号
        /// </summary>
        [BsonElement("DriverId")]
        public long DriverId { get; set; }
        /// <summary>
        /// 司机电话
        /// </summary>
        [BsonElement("DriverPhone")]
        public string DriverPhone { get; set; }
        /// <summary>
        /// 司机名称
        /// </summary>
        [BsonElement("UserName")]
        public string UserName { get; set; }
        /// <summary>
        /// 司机头像
        /// </summary>
        [BsonElement("Avatar")]
        public string Avatar { get; set; }
        /// <summary>
        /// 用户编号
        /// </summary>
        [BsonElement("UserId")]
        public long UserId { get; set; }

        /// <summary>
        /// 位置更新时间
        /// </summary>
        [BsonElement("ModifyTime")]
        public DateTime ModifyTime { get; set; }
        /// <summary>
        /// 归属合伙人
        /// </summary>
        [BsonElement("PartnerId")]
        public long? PartnerId { get; set; }
        /// <summary>
        /// 司机状态
        /// </summary>
        [BsonElement("DriverStatus")]
        public string DriverStatus { get; set; }

        /// <summary>
        /// 司机所在位置精度
        /// </summary>
        [BsonElement("Longitude")]
        public double Longitude { get { return this.longitude; } set { this.longitude = Math.Round(value, 8); } }
        /// <summary>
        /// 司机所在位置维度
        /// </summary>
        [BsonElement("Latitude")]
        public double Latitude { get { return this.latitude; } set { this.latitude = Math.Round(value, 8); } }
        /// <summary>
        /// 司机所在位置精维度
        /// </summary>
        [BsonElement("Coordinate")]
        public double[] DriverCoordinate { get; set; }
        /// <summary>
        /// 车辆当前进行中订单编号
        /// </summary>
        [BsonElement("OrderIds")]
        public long[] OrderIds { get; set; }
        /// <summary>
        /// 车辆状态
        /// </summary>
        [BsonElement("VehicleStatus")]
        public VehicleRunningStatus VehicleStatus { get; set; }
        /// <summary>
        /// 车辆状态
        /// </summary>
        [BsonElement("VehicleStatusStr")]
        public string VehicleStatusStr { get; set; }
        /// <summary>
        /// 已申请休假
        /// </summary>
        [BsonElement("IsHoliday")]
        public bool IsHoliday { get; set; }
        /// <summary>
        /// 休假开始时间
        /// </summary>
        [BsonElement("HolidayStartTime")]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime? HolidayStartTime { get; set; }
        /// <summary>
        /// 休假结束时间
        /// </summary>
        [BsonElement("HolidayEndTime")]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime? HolidayEndTime { get; set; }
        /// <summary>
        /// 休假备注
        /// </summary>
        [BsonElement("HolidayRemark")]
        public string HolidayRemark { get; set; }
        /// <summary>
        /// 当日拒单次数
        /// </summary>
        [BsonElement("TodayRejectOrderCount")]
        public int TodayRejectOrderCount { get; set; }
        /// <summary>
        /// 车辆运输批次编号
        /// </summary>
        [BsonElement("VehicleTransportBatchNo")]
        public string VehicleTransportBatchNo { get; set; }

    }
}
